

var comboxWithTree = new Ext.form.ComboBox({
	store : new Ext.data.SimpleStore({
		fields : [],
		data : [[]]
	}),
	disabled : combdisabled,
	editable : combeditable,
	triggerAction : triggerAction,
	mode : combmode,
	emptyText : emptyText,
	blankText : blankText,
	loadingText : loadingText,
	maxHeight : 200,
	tpl : "<tpl for='.'><div style='height:200px'><div id='combtree'></div></div></tpl>",
	selectedClass : '',
	onSelect : Ext.emptyFn
});

var combtree = new Ext.tree.TreePanel({
	loader : new Tree.YamTreeLoader({
		dataUrl : treeLoader,
		baseParams : {
			proxyParams : combproxyParams
		}
	}),
	border : false,
	root : new Ext.tree.AsyncTreeNode({
		text : '',
		id : 'root__1'
	})
});

combtree.on('click', function(node) {
	if (node.id.indexOf("root") == -1) {
		comboxWithTree.setValue(node.text);
		comboxWithTree.collapse();

		if (onSelect != "") {
			eval(onSelect);
		}
	}
});

comboxWithTree.on('expand', function() {
	var temproot = combtree.getRootNode();
	temproot.expand(false, true);
	combtree.rootVisible = false;
	combtree.render('combtree');
});

Ext.onReady(function() {
	if (ready) {
		comboxWithTree.id = id;
		comboxWithTree.render('comboxWith');
	}
});

var glossarycombid = 'glossarycomb';
var glossarycombcombdisabled = false;
var glossarycombcombeditable = false;
var glossarycombemptyText = '请选择';
var glossarycombblankText = '请选择';
var glossarycombloadingText = '读取数据中，请稍等……';
var glossarycombcombmode = 'local';

var glossarycombtriggerAction = 'all';
var glossarycombcombproxyUrl = '';
var glossarycombcombproxyParams = '';
var glossarycombtreeLoader = '';
var glossarycombvalueField = 'value';

var glossarycombdisplayField = 'text';
var glossarycombdiaplayType = 'List';
var glossarycombtreeLoader = '';
var glossarycombautoExpanded = false;
var glossarycombcombwidth = '200';
var glossarycombcombheight = '30';
var glossarycombdropwidth = '200';
var glossarycombdropheight = '350';
var glossarycombready = true;
var glossarycombonSelect = 'combselect()';
var glossarycomb = new Ext.form.ComboBox({
	disabled : glossarycombcombdisabled,
	editable : glossarycombcombeditable,
	emptyText : glossarycombemptyText,
	blankText : glossarycombblankText,
	loadingText : glossarycombloadingText,
	store : glossarycombcombstore,
	valueField : "value",

	displayField : "text",
	typeAhead : true,
	lazyInit : false,
	lazyRender : false,
	forceSelection : true,
	selectOnFocus : true,
	triggerAction : glossarycombtriggerAction,
	mode : glossarycombcombmode
});

Ext.onReady(function() {
	if (ready) {
		glossarycomb.render('comboxWith');
	}
});
var glossarycombcombhttpproxy = new Ext.data.HttpProxy({
	url : glossarycombcombproxyUrl,
	method : 'GET'
});
var glossarycombcombstorereader = new Ext.data.JsonReader({
	root : "Glossary"
}, [{
	name : "value",
	mapping : "glossaryid"
}, {
	name : "text",
	mapping : "glossaryname"
}]);
var glossarycombcombstore = new Ext.data.Store({
	proxy : glossarycombcombhttpproxy,
	reader : glossarycombcombstorereader,
	baseParams : {
		proxyParams : glossarycombcombproxyParams
	},
	autoLoad : true
});
glossarycomb.on("select", function() {
	if (onSelect != "") {
		eval(onSelect);
	}
});
